package com.gitee.feizns.itrip.personal.auth.service;

import com.gitee.feizns.itrip.personal.beans.dto.Token;
import com.gitee.feizns.itrip.personal.beans.pojo.User;
import com.gitee.feizns.itrip.personal.utils.service.BaseService;

/**
 * @author feizns
 * @since 2018/12/28 0028
 */
public interface LoginService extends BaseService<User> {

    /**
     * token 允许置换时间
     */
    int DEFAULT_TOKEN_ALLOW_REPLACE_TIME = 60 * 60 * 1000;      //1小时

    /**
     * 登录，生成token并缓存token
     * @param userCode
     * @param password
     * @return
     */
    Token login(String userCode, String password);

    /**
     * 获取或替换token
     * @param token
     * @return
     */
    Token reToken(String token);

    /**
     * 注销token
     */
    void logout(String token);

}

